<template>
	<section>
		<el-row>
  			<el-col :span="24">
	  			<div v-loading="loading" class="grid-content bg-purple">
					<el-menu >
						<el-menu-item index="1">用户I D：<span>{{userinfo.id}}</span></el-menu-item>
						<el-menu-item index="2">用户昵称：<span>{{userinfo.username}}</span></el-menu-item>
						<el-menu-item index="3">用户手机：<span>{{userinfo.phone==""?"暂无手机号":userinfo.phone}}</span></el-menu-item>
						<el-menu-item index="4">用户性别：<span>{{userinfo.sex==0?"未知":"userinfo.sex==1?'男':'女'"}}</span></el-menu-item>
						<el-menu-item index="5">注册平台：<span>{{userinfo.platFrom}}</span></el-menu-item>
						<el-menu-item index="6">注册时间：<span>{{userinfo.createTime}}</span></el-menu-item>
						<el-menu-item index="7">最近登陆：<span>{{userinfo.updateTime}}</span></el-menu-item>
					</el-menu>
		  		</div>
  			</el-col>
		</el-row>
	</section>
</template>
<script>
import { sendData,cutString  } from "../../api/api";
	export default {
		data(){
			return {
				loading:false,
				userinfo:[],
			}
		},
		methods:{
			getbaseinfo(){
				 let id=Number(sessionStorage.getItem("memberID"))
				 this.loading=true
				let params=sendData({url: "user/info",msg: {id:id}})
				this.$http.get(params.baseURL,{params:params.params}).then(res=>{
				var res=cutString(res.bodyText)
				console.log(res)
				res.msg[0].createTime=res.msg[0].createTime.slice(0,19)
				res.msg[0].updateTime=res.msg[0].updateTime.slice(0,19)
				this.userinfo=res.msg[0]
				this.loading=false
				})
			}
		},
		mounted() {
			this.getbaseinfo()
		}
	}
</script>
<style scoped>
.el-row {
  margin: 20px 0px;
}
.el-col {
  border-radius: 4px;
}
.bg-purple-dark {
  background: #99a9bf;
}
.bg-purple {
  min-height: 36px;
}
.bg-purple-light {
  background: #e5e9f2;
}
.grid-content {
  border-radius: 4px;
}
.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}

</style>